<template>
    <div>
        <div class="crumbs"> 
            <div class="container">
                
                 <div class="lu hnk"></div><div class="hnk jgxx">企业信息</div>
                 <div class="jgcontainer">
                    <!-- <div class="hnk con"> -->
                        <el-form ref="form" :model="form" label-width="80px">
                        <el-row :gutter="20" style="margin-top:20px;">
                            <el-col :span="10" style="margin-left:50px;">
                            <el-form-item label="企业简称">
                            <el-input class="handle-input" placeholder="追溯码上展示，不得超过6个字" v-model="form.name"></el-input>
                            </el-form-item>

                            <el-form-item label="所在区域">
                            <el-cascader :options="options" style="width:300px;">
                            <template slot-scope="{ node, data }">
                                <span>{{ data.label }}</span>
                                <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
                            </template>
                            </el-cascader>
                             </el-form-item>

                            <el-form-item label="营业执照照片">
                            <el-upload style="margin-left:30px;"
                                class="avatar-uploader"
                                action="https://jsonplaceholder.typicode.com/posts/"
                                :show-file-list="false"
                                :on-success="handleAvatarSuccess"
                                :before-upload="beforeAvatarUpload">
                                <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                            </el-upload>
                            </el-form-item>
                            </el-col>
                        <el-col :span="12">
                        <el-form-item label="企业名称">
                            <el-input class="handle-input" placeholder="企业全称" v-model="form.name"></el-input>
                        </el-form-item>
                        <el-form-item label="统一社会信用代码">
                            <el-input class="handle-input" placeholder="请输入统一社会信用代码" v-model="form.name"></el-input>
                        </el-form-item>
                        <el-form-item label="注册地址">
                            <el-input class="handle-input" placeholder="请填写详细注册地址" v-model="form.name"></el-input>
                        </el-form-item>
                        <el-form-item label="营业期限">
                            <el-col :span="8" style="margin-left:-10px;">
                                <el-date-picker  type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                            </el-col>
                             <el-col class="line" style="margin-left:15px;" :span="2">至</el-col>
                             <el-col :span="8">
                                <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                            </el-col>
                        </el-form-item>
                        <el-form-item label="营业范围">
                            <el-input
                            style="width:300px;"
                            type="textarea"
                            :autosize="{ minRows: 2, maxRows: 4}"
                            placeholder="请输入内容"
                            v-model="textarea2">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    </el-row>
                     </el-form>

                    <div style="height:1px; background:#E4E7ED;width:100%;"></div>
                    <div style="margin-top:20px;">
                        <div class="lu hnk"></div><div class="hnk jgxx">法人信息</div>
                    </div> 
                    <el-form ref="form" :model="form" label-width="80px">
                        <el-row :gutter="20" style="margin-top:20px;">
                            <el-col :span="10" style="margin-left:50px;">
                                <el-form-item label="身份证人像面照片">
                                    <el-upload style="margin-left:30px;"
                                        class="avatar-uploader"
                                        action="https://jsonplaceholder.typicode.com/posts/"
                                        :show-file-list="false"
                                        :on-success="handleAvatarSuccess"
                                        :before-upload="beforeAvatarUpload">
                                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                    </el-upload>
                                </el-form-item>
                                <el-form-item label="身份证国徽面照片">
                                    <el-upload style="margin-left:30px;"
                                        class="avatar-uploader"
                                        action="https://jsonplaceholder.typicode.com/posts/"
                                        :show-file-list="false"
                                        :on-success="handleAvatarSuccess"
                                        :before-upload="beforeAvatarUpload">
                                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                    </el-upload>
                                </el-form-item>
                            </el-col>
                            
                            <el-col :span="12">
                                <el-form-item label="法定代表人">
                                    <el-input class="handle-input" placeholder="请输入名字" v-model="form.name"></el-input>
                                </el-form-item>
                                <el-form-item label="身份证号码">
                                    <el-input class="handle-input" placeholder="" v-model="form.name"></el-input>
                                </el-form-item>
                                <el-form-item label="证件有效期">
                                    <el-col :span="8" style="margin-left:-10px;">
                                        <el-date-picker  type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                                        </el-col>
                                        <el-col class="line" style="margin-left:15px;" :span="2">至</el-col>
                                        <el-col :span="8">
                                        <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                                    </el-col>
                                </el-form-item>
                                <el-form-item label="手机号码">
                                    <el-input class="handle-input" placeholder="" v-model="form.name"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <div style="height:1px; background:#E4E7ED;width:100%;"></div>
                    <div style="margin-top:20px;">
                        <div class="lu hnk"></div><div class="hnk jgxx">运营者信息</div>
                    </div> 
                    <el-form ref="form" :model="form" label-width="80px">
                        <el-row :gutter="20" style="margin-top:20px;">
                            <el-col :span="10" style="margin-left:50px;">
                                <el-form-item label="身份证人像面照片">
                                    <el-upload style="margin-left:30px;"
                                        class="avatar-uploader"
                                        action="https://jsonplaceholder.typicode.com/posts/"
                                        :show-file-list="false"
                                        :on-success="handleAvatarSuccess"
                                        :before-upload="beforeAvatarUpload">
                                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                    </el-upload>
                                </el-form-item>
                                <el-form-item label="身份证国徽面照片">
                                    <el-upload style="margin-left:30px;"
                                        class="avatar-uploader"
                                        action="https://jsonplaceholder.typicode.com/posts/"
                                        :show-file-list="false"
                                        :on-success="handleAvatarSuccess"
                                        :before-upload="beforeAvatarUpload">
                                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                                    </el-upload>
                                </el-form-item>
                            </el-col>
                            
                            <el-col :span="12">
                                <el-form-item label="运营者姓名">
                                    <el-input class="handle-input" placeholder="请输入名字" v-model="form.name"></el-input>
                                </el-form-item>
                                <el-form-item label="身份证号码">
                                    <el-input class="handle-input" placeholder="" v-model="form.name"></el-input>
                                </el-form-item>
                                <el-form-item label="证件有效期">
                                    <el-col :span="8" style="margin-left:-10px;">
                                        <el-date-picker  type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                                        </el-col>
                                        <el-col class="line" style="margin-left:15px;" :span="2">至</el-col>
                                        <el-col :span="8">
                                        <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
                                    </el-col>
                                </el-form-item>
                                <el-form-item label="手机号码">
                                    <el-input class="handle-input" placeholder="" v-model="form.name"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <div style="height:1px; background:#E4E7ED;width:100%;"></div>
                    <div style="margin-top:20px;">
                        <div class="lu hnk"></div><div class="hnk jgxx">账号密码</div>
                    </div> 
                    <el-form ref="form" :model="form" label-width="80px">
                        <el-row :gutter="20" style="margin-top:20px;">
                            <el-col :span="10" style="margin-left:50px;">
                                <el-form-item label="用户名称">
                                    <el-input class="handle-input" placeholder="请输入手机号" v-model="form.name"></el-input>
                                </el-form-item>
                                <el-form-item label="确认密码">
                                    <el-input class="handle-input" placeholder="与密码保持一致" v-model="form.name"></el-input>
                                </el-form-item>
                            </el-col>
                            
                            <el-col :span="12">
                                <el-form-item label="密码">
                                    <el-input class="handle-input" placeholder="6-16位数字、字符、字母" v-model="form.name"></el-input>
                                </el-form-item>
                                
                            </el-col>
                        </el-row>
                    </el-form>

                    <el-button type="success" style="margin-left:500px; margin-top:50px;">保存</el-button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
   
    export default {
        data(){
            return{
                select2:'',
                select1:'',
                select:'',
                textarea2:'',
                imageUrl:'',
                options: [{
                    value: 'zhinan',
                    label: '指南',
                    children: [{
                        value: 'shejiyuanze',
                        label: '设计原则',
                    }]
                }],
                form: {
                name: '',
                region: '',
                date1: '',
                date2: '',
                delivery: false,
                type: [],
                resource: '',
                desc: '',
                
                }
            }
        },
        methods: {
        handleAvatarSuccess(res, file) {
            this.imageUrl = URL.createObjectURL(file.raw);
        },
        beforeAvatarUpload(file) {
            const isJPG = file.type === 'image/jpeg';
            const isLt2M = file.size / 1024 / 1024 < 2;

            if (!isJPG) {
            this.$message.error('上传头像图片只能是 JPG 格式!');
            }
            if (!isLt2M) {
            this.$message.error('上传头像图片大小不能超过 2MB!');
            }
            return isJPG && isLt2M;
            }
        }
    }
</script>

<style scoped>
    .crumbs{
        width:95%;
        margin:0 auto;
        margin-top: 30px;
        background: #ffffff;
    }
    .container{
        padding:10px;
    }
    .lu{
        width: 8px;
        height: 16px;
        background: greenyellow;
    }
    .hnk{
        display:inline-block;
    }
    .jgxx{
        margin-left:10px ;
        font-weight:600;
        font-size: 15px;
    }
    .jgcontainer{
        font-weight: 400;
    }
    .con{
        width:40%;
        padding: 20px;
        font-size: 14px;
        margin-left: 20px;
    }
    .handle-input {
        width: 300px;
        display: inline-block;
        /* margin-left: 30px; */
    }
    .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 100px;
    height: 100px;
    line-height: 100px;
    text-align: center;
  }
  .avatar {
    width: 100px;
    height: 100px;
    display: block;
  }
  
  
</style>